<template>
  <div>
    <ClassContent  class="class-info" :statusList="classStatusList" :buttons="buttonsInfo"/>
    <AttendanceSet></AttendanceSet>
    <AttendanceView></AttendanceView>
  </div>
</template>

<script setup>
import AttendanceSet from "@/components/class/attendance/AttendanceSet";
import AttendanceView from "@/components/class/attendance/AttendanceView";
import {ref} from "vue";
import { useClassManagerStore } from "@/store/store-class-manager-pinia";
import EventBus from "@/plugins/event-bus"
import ClassContent from "@/components/common/class/ClassContent.vue";

const classManagerStore = useClassManagerStore();
const toggleSetDialog = (rowInfo) => {
  let attendanceInfo = {
    className: rowInfo.class_name,
    classId: rowInfo.id
  }
  EventBus.emit("update-attendance-info-event",attendanceInfo)
  classManagerStore.toggleAttendanceManagerDialogVisible();
};


const toggleViewDialog = (rowInfo) => {
  let attendanceInfo = {
    className: rowInfo.class_name,
    classId: rowInfo.id
  }
  EventBus.emit("query-attendance-info-event",attendanceInfo)
  classManagerStore.toggleAttendanceViewDialogVisible();
};

const buttonsInfo= ref([
  { text: '设置', onClick: toggleSetDialog},
  { text: '查看', onClick: toggleViewDialog}
]);
const classStatusList = [2]

</script>

<style scoped lang="less">

</style>